/**
 * 
 */
package STUDENTS.DANGTIENLONG.MVC.Ex04;

/**
 * @author Tien Long
 *
 */
public class Models {
	public int CountDate(Date obj){
		int DateofMonth = 0;
		switch(obj.getMonth()){
		case 4:
		case 6:
		case 9:
		case 11: DateofMonth = 31; break;
		case 2:
			if (obj.getYear()%4 == 0 || (obj.getYear() % 4 == 0 && obj.getYear() % 100 != 0))
				DateofMonth = 29;
			else DateofMonth = 28;
			break;
		default: DateofMonth = 30; break;
		}
		return DateofMonth;
	}
}
